﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MODEL
{
    /// <summary>
    /// 扩展用户实体类
    /// </summary>
    public partial class qgzx_admin
    {
        #region 纯的实体对象 + ToPOCO()
        /// <summary>
        /// 纯的实体对象
        /// </summary>
        /// <returns></returns>
        public qgzx_admin ToPOCO()
        {
            qgzx_admin poco = new qgzx_admin()
            {
                Id = this.Id,
                LoginName = this.LoginName,
                Number = this.Number,
                Password = this.Password,
                Remark = this.Remark,
                Json = this.Json,
                DepartmentId = this.DepartmentId,
                BaseInfo = this.BaseInfo
            };
            return poco;
        } 
        #endregion


        #region 1.0 生成 TViewModel 实体对象 +ToViewModel
        /// <summary>
        /// 生成 很纯洁的 实体对象
        /// </summary>
        /// <returns></returns>
        public ViewModel.Admin ToViewModel()
        {
            ViewModel.Admin poco = new ViewModel.Admin()
            {
                Id = this.Id,
                LoginName = this.LoginName,
                Number = this.Number,
                Password = this.Password,
                Remark = this.Remark,
                Json = this.Json,
                BaseInfo = this.BaseInfo,
                DepartmentId=Convert.ToInt32(this.DepartmentId),

            };
            return poco;
        }
        #endregion

    }
}
